1. Field of the Invention
The present invention relates to graphical views of program structure during a debugging session. More particularly, the present invention relates to providing a graph for programming call or flow sequences on a visual display.
2. Background
A computer provides a multitude of services due to its structural ability to execute a set of instructions in different sequences. As computer architecture developed over the past half-century, instruction implementation has graduated from hard-wire connections to binary sequences to compilation of source code programs written in a high-level language (e.g., Fortran, C, Perl). Because syntax and logical errors may be introduced within a routine arising from human mistakes or oversight, programs must frequently be tested or otherwise evaluated to purge such “bugs” during software development. A computer programmer may use a debugger as a software tool to identify and correct these errors within a program source code.
High-level language source code incorporates human-recognizable symbolic characters for producing program instructions. These alpha-numeric and control characters in symbolic code (e.g., ASCII or American Standard Code for Information Interchange, EBCDIC and Unicode) correspond to binary sequences. The ASCII file may contain code structures, variable types and operational functions to be compared to the program's design intent by the programmer. A compiler translates the ASCII program file into an executable binary code for instruction execution by the computer.
Using a debugger, a programmer may sequentially “step” through the program code statements, while the corresponding machine instructions are being concurrently executed. While stepping through the code, a programmer may inter alia, monitor changes in selected diagnostic parameters to assist in discovering program flaws. While earlier historical epochs witnessed the necessity of line-printers to evaluate code, a modem programmer may read the code text and diagnostics on a screen monitor interactively with the statement sequencing.
Additionally, the programmer may also set a breakpoint at a specific program position with the debugger. During program execution, the debugger may interrupt execution when encountering a breakpoint and thereafter display selected program elements (e.g., software variables) to facilitate the debugging process. A debugger may also allow a programmer to define and set a conditional breakpoint to interrupt program execution if a condition evaluated at the breakpoint is satisfied (i.e., true).
Modular programming involves reducing a program into individual modules or procedures, each individually designed and tested. Such procedures can include subroutines and library functions called at particular locations in the program. A program may call a procedure in order to perform a particular task. Similarly, a procedure may be called by a program or another procedure (or recursively in some applications). The use of modular programming facilitates the production of a more concise logical structure, without disrupting the program organization by including routine instruction sets. Furthermore, a procedure can be replaced by another having the same functionality without disturbing the remainder of the source code.
Because modular programming has advantages for efficient program organization and maintenance, its incorporation has become a common practice in software design and many programming languages facilitate exploitation of this technique. However, as the modular design of a program becomes more complicated, the various interactions between program procedures may develop unwieldy patterns. Consequently, the programmer may engage in a difficult and time-consuming debugging session to validate the code to a modularly complex program.
A computer program may be visually represented by a graphical representation, e.g., a program call graph and a control flow graph. A program call graph or PCG may include a P_node associated with each programming procedure and its call relationship (e.g., to a main program or first procedure calling a second procedure or to a second procedure being called by the first procedure). A control flow graph or CFG may illustrate a plurality of basic blocks representing a procedure, each basic block denoted by a B_node.
Such graphs may be drawn by hand. Alternatively such a rendering may be produced using line-drawing software, such as the VCG (Visualization of Compiler Graphs) distributed under public license by GNU (GUI's Not Unix). However, these techniques require additional time and resources and may introduce additional interpretation discrepancies that necessitate further efforts to rectify without directly validating the software under evaluation.
Thus, an automatically generated graphical view of program structure during a debug session would be desirable for facilitating program debugging. Accordingly, there exists a need for an efficient, simple and inexpensive method for automatically rendering the logical and organizational structure of a program code in graphical format interactively on a screen monitor.